{include file="admin/header.htm"}
<form action="{$smarty.const.ADMIN_NAME}?m=admin&c=cat&a=man_cat" method="post" name="myform" onSubmit="return checkForm()">
<table cellpadding="2" cellspacing="1" class="table_form">
    <caption>添加分类</caption>
    <tr>
        <th><strong>分类名</strong></th>
        <td><input type="text" name="cat_name" value="{$cat.cat_name}"></td>
        <td><input type="submit" name="doadd" value=" 确定 " class="button_style"></td>
    </tr>
</table>
{if $parentid > 0}<input type="hidden" name="parentid" value="{$parentid}">{/if}
{if $cat}<input type="hidden" name="id" value="{$cat.id}">{/if}
</form>
{include file="admin/footer.htm"}
<script type="text/javascript">
function checkForm() {
    if(myform.cat_name.value == '') {
        alert('分类名不能为空！');
        return false;
    }
    return true;
}
</script>